package com.sdgakj.study.thread.pc.sychronized;

/**
 * @Author: Du Ronghong
 * @Description:
 * @Date: Created in 17:40 2018/8/28
 * @Modified By:
 */
public class Consumer implements Runnable {
    private Food food;

    public Consumer(Food food) {
        this.food = food;
    }

    @Override
    public void run() {
        while (true){
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            food.remove();
        }
    }
}
